//Component Object
const app = getApp();

Component({
  properties: {
    
  },
  data: {
    categoryList:[]
  },
  attached: function() {
    this.setData({
      categoryList:app.data.categoryList
    })
    console.info("app",app.data.categoryList);
  },
  methods: {
    getShopIconAdvert() {
      let that = this;
      let shop = app.functions.getLocalStorage("shop");
      if (app.functions.isEmpty(shop)) return;
      let params = {
        centerid: shop.centreId,
        supplyChannel: app.supplyChannel
      }
      app.api.iconAdvert(params, (response) => {
        if(response.data.categoryList.length>0){
          that.setData({
            categoryList: response.data.categoryList
          })
        }
      }, (e) => {
        app.functions.showToast(e.msg);
      })
    },
  },

  
  
});
  